<div class="promotion" >
	<!-- banner-->
	<section class="bannerarea">
		<div class="bannerimg"><img src="images/show/suyun/banner.png" class="img-responsive" alt="Responsive image"></div>
	</section>
	<!-- maincontent-->
	<section class="container">
		<div ng-controller="ctrlRead">
			<table class="table table-striped table-condensed table-hover">
				<tbody>
					<div class="activitybox row">
						<div class="areatitle">
							<h2 class="text-left"><span class="title">活动促销</span></h2>
							<p class="english"><span class="subtitle">ACTIVITY PROMOTION</span></p>
							<ul class="list-inline">
								<li class="active">全国</li>
								<li>华中</li>
								<li>华南</li>
								<li>华北</li>
							</ul>
						</div>
						<div class="col-sm-6 col-md-3" ng-repeat="item in pageItems">
							<div class="thumbnail">
								<img ng-src="{{item.titleImg}}" alt="活动一">

								<div class="caption">
									<p><a href="#/promotion_detail">{{item.title}}</a></p>
									<p class="text-right status">
										<span>{{item.statusStr}}</span>
									</p>
									<p class="text-right grey">{{item.startDateStr}}—{{item.endDateStr}}</p>
									<p class="text-right grey">{{item.activeScope}}</p>
								</div>
							</div>
						</div>
					</div>
				</tbody>
			</table>
			<!--  分页按钮 -->
			<div>
				<ul class="pagination pull-right">
					<li>
						<a href ng-click="prev()">上一页</a>
					</li>
					<li ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}">
						<a ng-click="selectPage(page)">{{ page }}</a>
					</li>
					<li>
						<a href ng-click="next()">下一页</a>
					</li>
				</ul>
			</div>
		</div>
	</section>
</div>
<!--<script type="text/javascript">
			bosfore_app.controller("ctrlRead",function($scope,$http){
				// 初始化值
				$scope.currentPage = 1 ;
				$scope.pageSize = 5 ;
				$scope.totalPage = 0 ;
				$scope.totalCount = 0 ;
				
				$scope.pageList = new Array();
				// 上一页的方法
				$scope.prev = function(){
					if($scope.currentPage > 1){
						$scope.selectPage($scope.currentPage-1);
					}
					
				}
				
				// 下一页的方法
				$scope.next = function(){
					if( $scope.currentPage < $scope.totalPage){
						$scope.selectPage($scope.currentPage+1);
					}
					
				}
				
				// 当前页
				$scope.selectPage = function(page){
					$http({
						method:'post',
						url:'promotion_pageQuery.action',
						params: {
							"page": page,
							"rows": $scope.pageSize
						}
					}).success(function(data){
						// 显示表格数据 
						$scope.pageItems = data.pageData;
						// 计算总页数
						$scope.totalCount = data.totalCount;
						// 总的页数
						$scope.totalPage = Math.ceil($scope.totalCount/$scope.pageSize);
						// 当前页
						$scope.currentPage = page;
						var begin;
						var end;
						
						begin = page-5;
						if(begin < 1){
							begin = 1;
						}
						
						end = begin + 9;
						if(end > $scope.totalPage){
							end = $scope.totalPage
						}
						
						begin = end - 9;
						if(begin < 1){
							begin = 1;
						}
						
						for(var i = begin ;i <= end ;i++){
							$scope.pageList.push(i)
						}
					}).error(function(data){
						alert("出错了")
					});
				}
				// 判断是否是当前页isActivePage(page)
				$scope.isActivePage = function(page){
					return $scope.currentPage === page;
				}
				
				//没次都初始化到第一页
				$scope.selectPage(1);
			});
		</script>-->
